﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;

namespace BLL
{
    public class UserBUO:IBUO<tbl_GiaoVu>
    {
        CSDLQLDiemHSC3DataContext context = new CSDLQLDiemHSC3DataContext();
        public bool Insert(tbl_GiaoVu obj)
        {
            throw new NotImplementedException();
        }

        public bool Delete(string id)
        {
            throw new NotImplementedException();
        }

        public bool Delete(tbl_GiaoVu obj)
        {
            throw new NotImplementedException();
        }

        public List<tbl_GiaoVu> GetAll()
        {
            throw new NotImplementedException();
        }

        public tbl_GiaoVu GetSingle(string id)
        {
            return context.tbl_GiaoVus.Where(n=>n.username.Equals(id)).FirstOrDefault();
        }

        public bool Update(string id, tbl_GiaoVu obj)
        {
            throw new NotImplementedException();
        }

        public bool CheckUser(string user, string pass)
        {
            var t = context.tbl_GiaoVus.Where(n => n.username.ToString().Equals(user) && n.password.ToString().Trim().Equals(MaHoaMD5.EncryptMD5(pass))).ToList();
            return t.Count == 1 ? true : false;
        }
    }
}
